import { defineStore } from "pinia";
import { GlobalState } from "@/interface/store";

export const useGlobalStore = defineStore({
  id: "globalStore",
  state: (): GlobalState => ({
    isCollapse: false,
    tabs: true,
    theme: "",
  }),
  actions: {
    // Set GlobalState
    setGlobalState(...args: ObjToKeyValArray<GlobalState>) {
      this.$patch({ [args[0]]: args[1] });
    },
  },
});
